package org.kailu.book.entity;
// default package
// Generated May 24, 2014 1:38:24 PM by Hibernate Tools 4.0.0

import org.kailu.book.entity.BillStationeryDetailsEntity;
import org.kailu.book.entity.ExportStationeryDetailsEntity;
import org.kailu.book.entity.TypeEntity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

/**
 * Stationery generated by hbm2java
 */
@Entity
@Proxy(lazy=false)
@Table(name = "stationery", catalog = "book")
public class StationeryEntity implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer stationeryId;
	private TypeEntity type;
	private String stationeryName;
	private int stationeryPrice;
	private String stationeryUnit;
	private int stationeryQuantity;
	private Set<BillStationeryDetailsEntity> billStationeryDetailses = new HashSet<BillStationeryDetailsEntity>(
			0);
	private Set<ExportStationeryDetailsEntity> exportStationeryDetailses = new HashSet<ExportStationeryDetailsEntity>(
			0);

	public StationeryEntity() {
	}

	public StationeryEntity(String stationeryName, int stationeryPrice,
			String stationeryUnit, int stationeryQuantity) {
		this.stationeryName = stationeryName;
		this.stationeryPrice = stationeryPrice;
		this.stationeryUnit = stationeryUnit;
		this.stationeryQuantity = stationeryQuantity;
	}

	public StationeryEntity(TypeEntity type, String stationeryName, int stationeryPrice,
			String stationeryUnit, int stationeryQuantity,
			Set<BillStationeryDetailsEntity> billStationeryDetailses,
			Set<ExportStationeryDetailsEntity> exportStationeryDetailses) {
		this.type = type;
		this.stationeryName = stationeryName;
		this.stationeryPrice = stationeryPrice;
		this.stationeryUnit = stationeryUnit;
		this.stationeryQuantity = stationeryQuantity;
		this.billStationeryDetailses = billStationeryDetailses;
		this.exportStationeryDetailses = exportStationeryDetailses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "stationery_id", unique = true, nullable = false)
	public Integer getStationeryId() {
		return this.stationeryId;
	}

	public void setStationeryId(Integer stationeryId) {
		this.stationeryId = stationeryId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "type_id")
	public TypeEntity getType() {
		return this.type;
	}

	public void setType(TypeEntity type) {
		this.type = type;
	}

	@Column(name = "stationery_name", nullable = false, length = 65535)
	public String getStationeryName() {
		return this.stationeryName;
	}

	public void setStationeryName(String stationeryName) {
		this.stationeryName = stationeryName;
	}

	@Column(name = "stationery_price", nullable = false)
	public int getStationeryPrice() {
		return this.stationeryPrice;
	}

	public void setStationeryPrice(int stationeryPrice) {
		this.stationeryPrice = stationeryPrice;
	}

	@Column(name = "stationery_unit", nullable = false, length = 65535)
	public String getStationeryUnit() {
		return this.stationeryUnit;
	}

	public void setStationeryUnit(String stationeryUnit) {
		this.stationeryUnit = stationeryUnit;
	}

	@Column(name = "stationery_quantity", nullable = false)
	public int getStationeryQuantity() {
		return this.stationeryQuantity;
	}

	public void setStationeryQuantity(int stationeryQuantity) {
		this.stationeryQuantity = stationeryQuantity;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "stationery")
	public Set<BillStationeryDetailsEntity> getBillStationeryDetailses() {
		return this.billStationeryDetailses;
	}

	public void setBillStationeryDetailses(
			Set<BillStationeryDetailsEntity> billStationeryDetailses) {
		this.billStationeryDetailses = billStationeryDetailses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "stationery")
	public Set<ExportStationeryDetailsEntity> getExportStationeryDetailses() {
		return this.exportStationeryDetailses;
	}

	public void setExportStationeryDetailses(
			Set<ExportStationeryDetailsEntity> exportStationeryDetailses) {
		this.exportStationeryDetailses = exportStationeryDetailses;
	}

}
